<%--<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>--%>
<%--<%--%>
	<%--String path = request.getContextPath() + "/AppDownload";--%>
	<%--System.out.println("应用目录=" + path);--%>
<%--%>--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<base href="<%=path%>">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<meta name="viewport" content="width=device-width, initial-scale=1">	<!-- 网页适配与手机 -->
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <style>         /* 遮罩提示图片向屏幕紧贴右上方 */
    .rightimg
    {
    position:absolute;
    right:0px;
    top:0px;
    }
    </style>



    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
	<script  charset="utf-8" type="text/javascript" src="<%=path%>/javascript/loading.js"></script>
    <title></title>
</head>
<body style="WIDTH:100%; background-color: lightslategrey ">
<div style="display: block ; background-repeat:no-repeat;" >
	<h2 align="center" style="padding-top: 30Px;">浙商移动销售</h2>
    <div align="center">
        <img src="<%=path%>/img/Icon_ios_sale.png" style="padding-top: 10px; height:120px">
    </div>
	<p style="align:center; margin:10px;padding-top:30px;color:#999999;line-height:20px">提示：若是在微信页面，请点击右上方的按钮，分享至“Safari”浏览器，使用“点击安装”按钮，安装应用程序，按home键在手机桌面查看应用</p>
    <div id = "div" align="center" style="margin-bottom: 30px;color: red;font-size: 20px">
      <button id = "div1" style="margin-top: 30px;border-width: 5px;border-color: #cccccc;border-radius: 10px;background-color: white;height: 50px;width: 150px; font-size: 20px;color: red" onclick="myfounction()">
           点击安装</button>
    </div>
</div>
<script>
  function  myfounction(){

    alipay_action();
      var browser = {
          versions: function() {
              var u = navigator.userAgent, app = navigator.appVersion;
              return {//移动终端浏览器版本信息
                  trident: u.indexOf('Trident') > -1, //IE内核
                  presto: u.indexOf('Presto') > -1, //opera内核
                  webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
                  gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
                  mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/AppleWebKit/), //是否为移动终端
                  ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
                  android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
                  iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器
                  iPad: u.indexOf('iPad') > -1, //是否iPad
                  webApp: u.indexOf('Safari') == -1 //是否web应该程序，没有头部与底部
              };
          }(),
          language: (navigator.browserLanguage || navigator.language).toLowerCase()
      }
      if (is_weixn()) {
          <%--alert("请点击右上角按钮, 点击使用浏览器打开");--%>
         alipay_action();
          return;
      }
      if (browser.versions.ios || browser.versions.iPhone || browser.versions.iPad) {
    var container = document.getElementById("div");
    var myNode = document.getElementById("div1");
    container.removeChild(myNode);
    var textnode=document.createTextNode("正在安装，请按Home键在桌面查看");

    container.appendChild(textnode); //3、在末尾中添加元素
          location.href="itms-services://?action=download-manifest&url=https://appplat.zsins.com:443/fileservice/plist/ios_app/ios_sale_prod.plist"
      }
      if (browser.versions.android) {
    var container = document.getElementById("div");
    var myNode = document.getElementById("div1");
    container.removeChild(myNode);
    var textnode=document.createTextNode("正在安装，请在桌面查看");

    container.appendChild(textnode); //3、在末尾中添加元素
          location.href="https://appplat.zsins.com:443/fileservice/plist/apk/ZSSingle_prod.apk"
      }

  };
  //判断是否是微信
  function is_weixn(){
      var ua = navigator.userAgent.toLowerCase();
      if(ua.match(/MicroMessenger/i)=="micromessenger") {
          return true;
      } else {
          return false;
      }
  }



    <%--function is_weixin() {--%>
    <%--var ua = navigator.userAgent.toLowerCase();--%>
    <%--if (ua.match(/MicroMessenger/i) == "micromessenger") {--%>
    <%--return true;--%>
    <%--} else {--%>
    <%--return false;--%>
    <%--}--%>
    <%--}--%>
    var isWeixin = is_weixin();  //判断是否为微信浏览器
    function loadHtml(){          //function loadHtml 载入遮罩与图片
    var div = document.createElement('div');

    div.id = 'weixin-tip';
    var winWidth = window.innerWidth;
    div.innerHTML = '<p><img class="rightimg" id="img" onClick="a()" src="./img/live_weixin.png" alt="请在浏览器中打开" /></p>';
    document.body.appendChild(div);
    var img = document.getElementById("img");
    var pre = 565/winWidth
    if (pre > 1){
    img.width = winWidth;
    img.height = 411/pre;
    }
    document.getElementById("weixin-tip").onclick = function(){ a() };
    }

    function loadStyleText(cssText) {	//function loadStyleText 遮罩CSS
    var style = document.createElement('style');
    style.rel = 'stylesheet';
    style.type = 'text/css';
    try {
    style.appendChild(document.createTextNode(cssText));
    } catch (e) {
    style.styleSheet.cssText = cssText;
    }
    var head=document.getElementsByTagName("head")[0];
    head.appendChild(style);
    }
    var cssText = "#weixin-tip{position: fixed; right:0px; top:0px; background: rgba(0,0,0,0.8); filter:alpha(opacity=80); width: 100%; height:100%; z-index: 100;} #weixin-tip p{text-align: center; margin-top: 10%; padding:0 5%;}";

    function a(){						//点击图片或者弹出的遮罩后 隐藏整个遮罩div
    document.getElementById("weixin-tip").style.display = 'none';
    }

    function alipay_action(){			//点击选择支付宝以后 弹出遮罩  第一次为新建div weixin-tip 第二次显示隐藏的weixin-tip
    if(isWeixin){
    if (!document.getElementById("weixin-tip")){
    loadHtml();
    loadStyleText(cssText);
    }else{
    document.getElementById("weixin-tip").style.display = 'block'
    }
    }
    }
    </script>



    <script type="text/javascript"> //当点击alipay的div时才会弹出遮罩 并且使下一步按钮生效
    var alipay = document.getElementById('alipay');
    var btnext = document.getElementById('btn_next');
    alipay.onclick = function (){
    alipay_action()
    if (is_weixin()){
    btnext.disabled=true;
    }
    }

    function btn_useful(){  //点击除了alipay以外的渠道div时使下一步按钮有效
    var bt_next = document.getElementById('btn_next');
    bt_next.disabled=false;
    }
</script>
</body>
</html>
